<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="path" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html lang="zh-CN" data-locale="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css"
	href="${path }/static/css/test.css">
<link rel="stylesheet" href="${path }/static/css/zyupload-1.0.0.min.css"
	type="text/css">
<script type="text/javascript" src="${path }/static/js/jquery-1.7.2.js"></script>
<script type="text/javascript"
	src="${path }/static/js/zyupload-1.0.0.js"></script>
<title>上传照片和视频 · YXTP</title>
</head>
<body class="signed-in">
	<div class="navbar-height-padding"></div>
	<header class="js-navbar navbar">
		<div class="navbar__container">
			<div class="navbar__container__item">
				<div class="navbar__navigation">
					<a class="navbar__navigation__logo" data-track-action="navbar"
						data-track-label="logo" href="/zh-cn/" title="免费素材照片">
						<div class="navbar__navigation__logo__img">
							<svg xmlns="http://www.w3.org/2000/svg" width="32px"
								height="32px" viewBox="0 0 32 32">
									<path
									d="M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z"
									fill="#05A081"></path>
									<path
									d="M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z"
									fill="#fff"></path>
								</svg>
						</div>
						<div
							class="navbar__navigation__item navbar__u-hidden-on-mobile rd__button rd__button--text"
							href="/zh-cn/">YXTP</div>
					</a>
				</div>
				<div
					class="navbar__u-hide-when-transparent navbar__container__item__search">
					<form action="/zh-cn/search-photos/" role="search">
						<div
							class="rd__text-input rd__text-input--small rd__text-input--with-button rd__text-input--transparent">
							<input autocapitalize="none" name="s" placeholder="搜索免费照片"
								required="required" type="search" value="">
							<button class="rd__button">
								<i class="rd__svg-icon rd__svg-icon--20x20"><svg
										xmlns="http://www.w3.org/2000/svg" width="24" height="24"
										viewBox="0 0 24 24">
										<path
											d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path></svg>
								</i>
							</button>
						</div>
					</form>
				</div>
			</div>
			<div class="navbar__container__item">
				<div class="rd__button-group rd__button-group--no-shadow">
					<div
						class="navbar__u-hidden-on-tablet rd__dropdown rd__dropdown--right"
						data-dropdown-initialized="true">
						<a
							class="navbar__navigation__item rd__button rd__button--compact rd__button--text"
							data-track-action="navbar" data-track-label="explore"
							href="/zh-cn/discover/"> 探索 </a>

					</div>

					<div
						class="show-if-signed-in navbar__hidden-on-mobile--if-transparent rd__dropdown rd__dropdown--right"
						data-dropdown-initialized="true">
						<button
							class="rd__button rd__button--compact rd__button--text navbar__navigation__item__notification js-notifications-trigger"
							data-track-action="navbar" data-track-label="notifications">
							<i
								class="js-notification-icon rd__svg-icon rd__svg-icon--large rd__svg-icon--grey">
								<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
									<path
										d="M3.805 7.2h.503a.63.63 0 0 0 .629.629.63.63 0 0 0 .629-.629h.503c0 .625-.507 1.132-1.132 1.132S3.805 7.826 3.805 7.2zm4.403-.63v.126a.5.5 0 0 1-.503.503h-5.535c-.278 0-.503-.225-.503-.503v-.126a.88.88 0 0 1 .755-.872v-1.518c0-1.4 1.126-2.516 2.516-2.516s2.516 1.126 2.516 2.516V5.7a.88.88 0 0 1 .755.872zm-.503 0c0-.21-.17-.377-.378-.377s-.376-.17-.376-.376V4.182c0-1.11-.9-2.013-2.013-2.013s-2.013.9-2.013 2.013V5.82c0 .208-.17.376-.376.376s-.378.17-.378.377v.126h5.535v-.126z"
										fill="#fff" fill-rule="nonzero" stroke-width="0"></path></svg>
							</i>
						</button>

					</div>
					<div
						class="show-if-signed-in navbar__u-hidden-on-mobile rd__dropdown rd__dropdown--right"
						data-dropdown-initialized="true">
						<a
							class="rd__button rd__button--compact rd__button--text-grey rd__button--account-details"
							href="/zh-cn/me/">
							<div class="rd__avatar rd__avatar--bordered">
								<img alt="avatar" class="js-avatar"
									src="https://www.gravatar.com/avatar/f8fcc3d6d676871756c5ad00c52e0a67?s=60&amp;d=mm">
							</div> <i class="rd__svg-icon"><svg
									xmlns="http://www.w3.org/2000/svg" width="24" height="24"
									viewBox="0 0 24 24">
									<path d="M7.41 7.84L12 12.42l4.59-4.58L18 9.25l-6 6-6-6z"></path></svg>
						</i>
						</a>

					</div>
					<a
						class="show-if-signed-in navbar__u-hidden-on-mobile rd__button rd__button--compact"
						data-track-action="navbar" data-track-label="submit"
						href="submitPhoto。jsp" rel="nofollow" style="margin-right: 0">
						上传内容 </a> <a
						class="hide-if-signed-in navbar__u-hidden-on-mobile rd__button rd__button--compact"
						data-track-action="navbar" data-track-label="submit-photos"
						href="submitPhoto。jsp" rel="nofollow"> 上传内容 </a>
				</div>

			</div>
		</div>
	</header>
	<div class="l-container-center l-container--sm">
		<h1 class="headline">上传照片和视频</h1>
		<ul class="upload-info-list">
			<input type="hidden" name="username" value="${user.username }">
			<li>你上传的照片将在 YXTP 免费发布。</li>
			<li>确保主要人物同意发布你的照片或视频。</li>
			<li>我们将会审核你提交的内容，如果它被选中，然后它就会出现在我们的主页和搜索中。</li>
		</ul>
		<div id="zyupload" class="zyupload"></div>
		<!--<div class="upload-submit" style="box-sizing: content-box;">
				<input type="submit" class="btn-secondary " value="上传"/>
			</div>-->
		<!--<form method="post" action="index.html" class="upload-submit ">
				<input type="hidden" name="id" />
				<input type="submit " class="btn-secondary " value="发布 ">
			</form>-->
	</div>
	<script type="text/javascript">
		$(function() {
			contentPath = '${path}'
			// 初始化插件
			$("#zyupload").zyUpload({
				width : "650px", // 宽度
				height : "400px", // 宽度
				itemWidth : "140px", // 文件项的宽度
				itemHeight : "115px", // 文件项的高度
				url : contentPath + "/upload/uploadAction?uid=${user.uid }&username=${user.username}", // 上传文件的路径
				fileType : [ "jpg", "png", "txt", "js", "exe" ],// 上传文件的类型
				fileSize : 51200000, // 上传文件的大小
				multiple : true, // 是否可以多个文件上传
				dragDrop : true, // 是否可以拖动上传文件
				tailor : true, // 是否可以裁剪图片
				del : true, // 是否可以删除文件
				finishDel : false, // 是否在上传文件完成后删除预览
				/* 外部获得的回调接口 */
				onSelect : function(selectFiles, allFiles) { // 选择文件的回调方法  selectFile:当前选中的文件  allFiles:还没上传的全部文件
					console.info("当前选择了以下文件：");
					console.info(selectFiles);
				},
				onDelete : function(file, files) { // 删除一个文件的回调方法 file:当前删除的文件  files:删除之后的文件
					console.info("当前删除了此文件：");
					console.info(file.name);
				},
				onSuccess : function(file, response) { // 文件上传成功的回调方法
					console.info("此文件上传成功：");
					console.info(file.name);
					console.info("此文件上传到服务器地址：");
					console.info(response);
					$("#uploadInf").append("<p>上传成功!</p>");
				},
				onFailure : function(file, response) { // 文件上传失败的回调方法
					console.info("此文件上传失败：");
					console.info(file.name);
				},
				onComplete : function(response) { // 上传完成的回调方法
					console.info("文件上传完成");
					console.info(response);
				}
			});

		});
	</script>
</body>
</html>